//
//  DEMineMainTabbarController.m
//  Devote_RongCloud
//
//  Created by 郭树清 on 2018/4/17.
//  Copyright © 2018年 KuoShuChing. All rights reserved.
//

#import "DEMineMainTabbarController.h"
#import "KSNavigationController.h"
//#import "DEMyHomePageViewController.h"
//#import "DENearbyViewController.h"
//#import "DEGameViewController.h"

@interface DEMineMainTabbarController ()

@end

@implementation DEMineMainTabbarController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self setupChildVC];
}
//初始化我们的子控制器
- (void)setupChildVC{
    //主页
//    [self setUpChildViewController:[[DEMyHomePageViewController alloc]init] title:@"主页" imageNamed:@"主页未选中" selectedImageNamed:@"主页选中"];
//        //附近
//    [self setUpChildViewController:[[DENearbyViewController alloc]init] title:@"附近" imageNamed:@"周边未选中" selectedImageNamed:@"周边选中"];
//    //游戏
//    [self setUpChildViewController:[[DEGameViewController alloc]init] title:@"游戏" imageNamed:@"我的游戏-未选中" selectedImageNamed:@"我的游戏-选中"];
    
}
-(void)setUpChildViewController:(UIViewController *)vc title:(NSString *)title imageNamed:(NSString *)imageName selectedImageNamed:(NSString *)selectedImageName
{
    
    UINavigationController *nav = [[KSNavigationController alloc]initWithRootViewController:vc];
    vc.title = title;
    vc.tabBarItem.image = [UIImage imageNamed:imageName];
//    vc.tabBarItem.selectedImage = [UIImage imageNamed:selectedImageName].originarImage;
    //设置文字 注意:文字大小只能在Normal状态下设置
    //设置文字的颜色
    NSMutableDictionary *textAttrs = [NSMutableDictionary dictionary];
//    textAttrs[NSForegroundColorAttributeName] =[UIColor hexStringToColor:@"#888888"];
    
    NSMutableDictionary *selectTextAttrs = [NSMutableDictionary dictionary];
//    selectTextAttrs[NSForegroundColorAttributeName] = [UIColor hexStringToColor:@"#ff8900"];
    
    [vc.tabBarItem setTitleTextAttributes:textAttrs forState:UIControlStateNormal];
    [vc.tabBarItem setTitleTextAttributes:selectTextAttrs forState:UIControlStateSelected];
    
    [self addChildViewController:nav];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
